package chapter2.No2_1_synchronized同步方法.b实例变量非线程安全;

/**
 * *：实例变量非线程安全，如果像要线程安全，可以用synchronized关键字
 *
 * @author liujian
 * @version 2016/11/11 0011
 */
public class Main {

    public static void main(String[] args) {
        TestObject to = new TestObject();

        ThreadA a = new ThreadA(to);
        a.setName("a");
        a.start();

        ThreadB b = new ThreadB(to);
        b.setName("b");
        b.start();
    }

}
